-
Notifications
You must be signed in to change notification settings - Fork 751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SYCL][CUDA] Implement Intel USM extension #1241
Conversation
This comment has been minimized.
This comment has been minimized.
99c9d32
to
1af2918
Compare
@fwyzard, thanks a lot for working on this. |
1af2918
to
d0c1f96
Compare
Updated to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! @jbrodman will be happy :-) Few comments around.
Have you enabled any of the USM lit test to see if they pass?
sycl/plugins/cuda/pi_cuda.cpp
Outdated
|
||
if (event) { | ||
retImplEv = std::unique_ptr<_pi_event>( | ||
_pi_event::make_native(PI_COMMAND_MEMBUFFER_COPY, command_queue)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not in the scope of this change, but the PI_COMMAND_MEMBUFFER_COPY is used for the non-usm operations. We probably need a different PI_COMMAND_USM_COPY for usm operations, since the OpenCL function is different in the cl_intel_unified_sahred_memory extension
ae88ebb
to
7f60dbf
Compare
I've implemented I still need to look into using If I missed anything, please mention it (again). |
7f60dbf
to
a1e51fc
Compare
Still looking to see if there are more lit tests passing, USM tests are marked as "unsupported" for the CUDA backend so they won't report if they are passing now. |
How do I run the USM tests with the CUDA backend ? I have tried removing the
Which is not what I expected, because
|
In fact, looking at the tests being built and run, it looks like
|
About the behaviour of However, it looks like there are still some corner case that are not very clear. According to Table 5 in cl_intel_unified_shared_memory:
so,
so The table under USM Allocations in the USM proposal mentions for the
so
so
so |
89fd6ab
to
edf470d
Compare
No. It's mostly complete, but there are still things that might change as we get more experience and usage.
Yes.
Yes.
TBD.
Correct.
Not entirely. P2P is kind of a special case. This is more is one shared allocation able to migrate between different devices in a platform. P2P is really more about if it can migrate directly without needing to go through the host.
Correct. I don't expect to really be done until multiple vendors implement the same protocol for coherent device attach. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
@jbrodman thank you very much for the clarifications.
I see. |
59316da
to
da4eebb
Compare
Signed-off-by: Andrea Bocci <andrea.bocci@cern.ch>
Device - USM-related calls to piDeviceGetInfo Kernel - piextKernelSetArgPointer USM - piextUSMHostAlloc - piextUSMDeviceAlloc - piextUSMSharedAlloc - piextUSMFree - piextUSMEnqueueMemset - piextUSMEnqueueMemcpy - piextUSMEnqueuePrefetch (*) - piextUSMEnqueueMemAdvise (*) - piextUSMGetMemAllocInfo (*) due to the incomplete documentation of the USM extension: - piextUSMEnqueuePrefetch ignores the "flags" argument; - piextUSMEnqueueMemAdvise does nothing. Signed-off-by: Andrea Bocci <andrea.bocci@cern.ch>
Signed-off-by: Andrea Bocci <andrea.bocci@cern.ch>
7039ac0
to
8f3d479
Compare
Fixed commit history, rebased on top of #1310 . |
#1310 has been merged. @fwyzard did you manage to get the LIT tests to work for CUDA? I am not sure (haven’t tested) if your |
I'm actually testing with all these PRs on top o fthe
but I haven't gotten around to trying the LIT tests, yet. |
Implement the following functions in the CUDA plugin, and mark the tests for the USM features that are now supported.
Also, fix the CUDA version reported by SYCL.
Device
piDeviceGetInfo()
Kernel
piextKernelSetArgPointer()
USM
piextUSMHostAlloc()
piextUSMDeviceAlloc()
piextUSMSharedAlloc()
piextUSMFree()
piextUSMEnqueueMemset()
piextUSMEnqueueMemcpy()
piextUSMEnqueuePrefetch()
piextUSMEnqueueMemAdvise()
(see below)piextUSMGetMemAllocInfo()
(see below)Limitations
As the Intel USM extension is still incomplete:
piextUSMEnqueuePrefetch()
ignores the "flags" argument;piextUSMEnqueueMemAdvise()
does nothing.